MGMT 675



AI-Assisted Financial Analysis

Autocorrelation

  • Correlation of a variable with its own lagged value
  • First order autocorrelation = first lag
  • Second order autocorrelation = second lag

Example

Time Variable
1 2.1
2 4.5
3 5.3
4 3.2
5 1.6

Example

Time Variable Lag
1 2.1
2 4.5 2.1
3 5.3 4.5
4 3.2 5.3
5 1.6 3.2

Example

Time Variable Lag
1 2.1
2 4.5 2.1
3 5.3 4.5
4 3.2 5.3
5 1.6 3.2

Correlation of a variable with its lag is first-order autocorrelation.

Second-order autocorrelation

Time Variable 2nd Lag
1 2.1
2 4.5
3 5.3 2.1
4 3.2 4.5
5 1.6 5.3

Correlation of a variable with its 2nd lag is second-order autocorrelation.

Autocorrelation function

  • The autocorrelation function (acf) shows autocorrelation at multiple lags.
  • Lag 0 is usually presented too, even though the correlation at lag 0 is always 100%.
  • The band is a confidence interval under the null hypothesis that the autocorrelation is zero.
  • Estimates outside the band are statistically significant.

Fama-French factors

  • Ask Julius to use pandas datareader to get the monthly Fama-French factors for the maximum history available.
  • Ask Julius to plot the acf’s of Mkt-RF, HML, and SMB.

Autoregressions

First-order autoregression

  • A first-order autoregression is the equation \[x_t = \alpha + \beta x_{t-1} + \varepsilon_t\]
  • Positive \(\beta \Leftrightarrow\) positive first-order autocorrelation.
  • Positive beta \(\Rightarrow\) momentum.
  • Negative beta \(\Rightarrow\) reversals.

Higher order autoregressions

  • A \(p\)th order autoregression is the equation \[x_t = \alpha + \beta_1x_{t-1} + \cdots + \beta_px_{t-p} + \varepsilon_t\]
  • There are standard methods for choosing the optimal \(p\), trading off goodness of fit and parsimony.
  • Ask Julius to fit an AR(p) to HML and find the optimal \(p\).

Levels or changes?

What should we try to forecast?

  • Price of AAPL?
  • Change in price of AAPL?
  • Percent change in price of AAPL (return)?
  • A forecast of changes or percent changes implies a forecast of the price and vice versa, so only need to forecast one of them directly.
  • What variable should we use in an autoregression?

Stationarity

  • One issue is that autocorrelation or autoregression estimates are reliable only for stationary variables.
  • Prices grow over time (unstationary).
  • Changes in prices become larger over time (in absolute value)
  • Returns are the right thing to use in an autoregression.

Other variables

  • Autoregression for crude oil price or change in crude price or percent change in crude price?
  • Autoregression for interest rate or change in interest rate or percent change in interest rate?

Autoregression and \(\Delta x\)

Rearrange \[x_t = \alpha + \beta x_{t-1} + \varepsilon_t\] as \[\Delta x_t = \alpha + (\beta-1) x_{t-1} + \varepsilon_t\] \[\Delta x_t = (\beta-1)\left(x_{t-1} - \frac{\alpha}{1-\beta}\right) + \varepsilon_t\]

Mean reversion

  • An AR(1) is \[\Delta x_t = (\beta-1)\left(x_{t-1} - \frac{\alpha}{1-\beta}\right) + \varepsilon_t\]

  • \(\beta<1\) implies reregression towards the mean.

  • The mean is \(\alpha/(1-\beta)\).

  • \(\beta>1\) implies nonstationary.

Simulations

  • Ask Julius to simulate the process x_t = 1 + 0.5*x_{t-1} + e_t by drawing 1,000 standard normals for e_t. Ask Julius to plot the process.
  • Repeat for x_t = 1 + 2*x_{t-1} + e_t

Autocorrelations

  • Autocorrelation = correlation of a variable with its lagged value
  • First-order autocorrelation \(=\text{corr}(x_t, x_{t+1})\)
  • \(p\)–th order autocorrelation \(=\text{corr}(x_t, x_{t+p})\)
    • E.g., \(p=12\) in monthly data or \(p=4\) in quarterly data because of seasonality

Autocorrelation of HML

  • Ask Julius to use pandas-datareader to download the monthly Fama-French factors from Ken French’s data library.
  • Ask Julius to produce a plot of the autocorrelation function (acf) for HML.

Autoregressions

  • An autoregression is a regression of a variable on its own lags: \[x_t = \alpha + \beta_1x_{t-1} + \cdots + \beta_px_{t-p} + \varepsilon_t\]
  • Ask Julius to fit an AR(1) for HML.
  • Ask Julius to use the AR(1) model to forecast HML for the next 12 months and to plot the last 2 years and the forecasts.

More examples

Ask Julius to plot the ACF, fit an AR model, and forecast the following:

  • Percent change in crude price: Ask Julius to use pandas-datareader to download crude oil prices starting in 1980 from FRED, to downsample to end-of-month, and to compute percent changes.

  • Change in Treasury yields: Ask Julius to use pandas-datareader to download 10-year Treasury yields starting in 1980 from FRED, to downsample to monthly, and to compute changes.

Vector Autoregression

  • Forecast related variables based on their mutual lags
  • Example: does this month’s SMB return forecast next month’s HML return?
  • Ask Julius to run a VAR(1) on the Fama-French factors and provide a summary of the results.